package com.tuni.birthdaymoney.web.model;

import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.tuni.birthdaymoney.persistence.entity.Department;
import com.tuni.birthdaymoney.persistence.entity.Person;
import com.tuni.birthdaymoney.persistence.entity.Position;
import com.tuni.birthdaymoney.persistence.entity.Role;

public class PersonEditorPage {

    private String title;
    private String submitText;
    private String formAction;
    private String password;
    private boolean showPasswordInput;
    private boolean saveAsUser;
    private Person person;
    private Iterable<Position> positions;
    private Iterable<Department> departments;
    private Role role;
    private CommonsMultipartFile fileData;

    public CommonsMultipartFile getFileData() {
		return fileData;
	}

	public void setFileData(CommonsMultipartFile fileData) {
		this.fileData = fileData;
	}

	public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSubmitText() {
        return submitText;
    }

    public void setSubmitText(String submitText) {
        this.submitText = submitText;
    }

    public String getFormAction() {
        return formAction;
    }

    public void setFormAction(String formAction) {
        this.formAction = formAction;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isShowPasswordInput() {
        return showPasswordInput;
    }

    public void setShowPasswordInput(boolean showPasswordInput) {
        this.showPasswordInput = showPasswordInput;
    }

    public boolean isSaveAsUser() {
        return saveAsUser;
    }

    public void setSaveAsUser(boolean saveAsUser) {
        this.saveAsUser = saveAsUser;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public Iterable<Position> getPositions() {
        return positions;
    }

    public void setPositions(Iterable<Position> positions) {
        this.positions = positions;
    }

    public Iterable<Department> getDepartments() {
        return departments;
    }

    public void setDepartments(Iterable<Department> departments) {
        this.departments = departments;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }
    
    public boolean fileDataNotNullOrEmpty() {
        return fileData != null && !fileData.isEmpty();
    }
}
